<?php
namespace jy_merch;
defined('BY_JYA') or exit('error');
/*
	本插件：$this->model('diy')->方法名();
	其他地方调用：model('jy_merch/diy')->方法名();
*/
class diy extends \plugin{
	/*
		小店首页类型
	*/
	public function checkmerchurl($merchid=0,$merchurl=''){
		$merchbasic=$this->plugin_setting('basic'.$merchid);
		if(!$merchbasic['merchurl']){
			if($merchurl){
				if($merchurl==1){
					return 1;
				}else{
					exi('','',$merchurl.'merchid='.$merchid);
				}
			}
		}elseif($merchbasic['merchurl']==1){
			return 1;
		}
		return 0;
	}
	public function merchfooternav($merchid=0,$pluginset=array()){
		if($_SESSION['merchfooternav']){
			return $_SESSION['merchfooternav'];
		}
		$merchfooternav=$pluginset['merchfooternav'];
		$merchbasic=$this->plugin_setting('basic'.$merchid);
		if(!$merchbasic['merchurl']){
			if($pluginset['merchurl']){
				if($pluginset['merchurl']==1){
					$merchfooternav=$merchbasic['merchfooternav'];
				}
			}
		}elseif($merchbasic['merchurl']==1){
			$merchfooternav=$merchbasic['merchfooternav'];
		}
		return $merchfooternav;
	}
}